Reads a text file and returns the contents to a variable.
Syntax
ReadTextFile("FilePath", Encoding)
Arguments
| Argument | Description |
|---|---|
| FilePath | Full path to the file to read. See Identifying files and directories in statements for information about configuring full paths relative to the workspace or script directory. |
| Encoding | File encoding constant. If not specified, EncodingAutoDetect is used. See Constants. |
Return value
| Value | Description |
|---|---|
| Value | File contents. |
Example
output = ReadTextFile("C:\\Testing\\Output.txt", EncodingAutoDetect)
PrintLn("File content: " + output)